package cn.txun.csmall.passport.security;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 用户详情类
 *
 * @author java@txun.cn
 * @version 0.0.1
 */
//@Data：要求超类必须有无参构造
public class AdminDetails extends User {
    @Getter
    private Long id;
    // new AdminDetails(1L,aaa,aaaa,true,权限);
    // new AdminDetails(2L,bbb,bbbb,false,权限);
    //new AdminDetails(3L,ccc,cccc,true,权限);
    public AdminDetails(Long id,String username, String password, boolean enabled ,Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, true, true, true, authorities);
        this.id = id;
    }
}
